package com.demo.skill.proxy;

public class CountProxy implements com.demo.skill.proxy.Count {

    private com.demo.skill.proxy.CountImpl count;


    public CountProxy(com.demo.skill.proxy.CountImpl count) {
        this.count = count;
    }

    public void queryCount() {
        System.out.println("代理查看前");
        this.count.queryCount();
        System.out.println("代理查看后");
    }

    public void updateCount() {
        System.out.println("代理请求前");
        this.count.updateCount();
        System.out.println("代理请求后");
    }

    public static void main(String[] args) {
        com.demo.skill.proxy.CountImpl count = new com.demo.skill.proxy.CountImpl();
        CountProxy proxy = new CountProxy(count);
        proxy.queryCount();
        proxy.updateCount();
    }
}
